#define  _CRT_SECURE_NO_WARNINGS 1

//#include <iostream>
//
//using namespace std;
//
//int main()
//{
//	int* p1 = new int(0);
//
//	cout << *p1 << endl;
//
//	int* p2 = new int(10);
//
//	cout << *p2 << endl;
//
//	int* p3 = new int[5] {1, 2, 3, 4, 5};
//
//	for (int i = 0; i < 5; ++i)
//	{
//		cout << p3[i] << " ";
//	}
//	cout << endl;
//
//	delete p1;
//	delete p2;
//	delete[] p3;
//
//	return 0;
//}

#include <iostream>

using namespace std;

class A
{
public:
	A(int a1 = 1, int a2 = 2, int a3 = 3)
		:_a1(a1)
		, _a2(a2)
		, _a3(a3)
	{
		cout << "A(int a1 = 1, int a2 = 2, int a3 = 3)" << endl;
	}

	~A()
	{
		cout << "~A()" << endl;
	}

private:
	int _a1 = 1;
	int _a2 = 2;
	int _a3 = 3;
};

int main()
{
	/*A a1 = { 1,2,3 };

	A a2 = (2);

	A* p1 = new A{ 10,20,30 };

	delete p1;*/

	A aa1;
	A aa2;
	A aa3;

	A* p1 = new A[3]{ aa1,aa2,aa3 };
	A* p2 = new A[3]{ {1,2,3},{4,5,6},{7,8,9} };
	A* p3 = new A[3]{ A(1,2,3),A(4,5,6),A(7,8,9) };

	delete[] p1;
	delete[] p2;
	delete[] p3;

	return 0;
}